import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import CounterBox from './containers/counter-box';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import registerServiceWorker from './registerServiceWorker';
import counter from './reducers';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';

const store = createStore(
  counter,
  window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
);

ReactDOM.render(
  <Provider store={store}>
    <Router>
      {/* <Switch> */}
      <div>
        <Route path="/" exact component={App} />
        <Route path="/counter" component={CounterBox} />
      </div>
      {/* </Switch> */}
    </Router>
  </Provider>,
  document.getElementById('root')
);
registerServiceWorker();
